home *** CD-ROM | disk | FTP | other *** search
- Path: news1.h1.usa.pipeline.com!usenet
- From: grantp@usa.pipeline.com(Pete)
- Newsgroups: comp.lang.c++
- Subject: Re: VC++4.0 & SQL
- Date: 17 Feb 1996 12:08:07 GMT
- Organization: Kalevi, Inc.
- Message-ID: <4g4gf7$pgb@news1.usa.pipeline.com>
- NNTP-Posting-Host: pipe2.h1.usa.pipeline.com
- X-PipeUser: grantp
- X-PipeHub: usa.pipeline.com
- X-PipeGCOS: (Pete)
- X-Newsreader: Pipeline USA v3.3.0
-
- On Feb 15, 1996 21:25:16 in article <VC++4.0 & SQL>, 'schlaep@ibm.net
- (Patrick Schlaepfer)' wrote:
-
-
- >Source code of the SQL testprogram, copied
- >from the MS Visual C++ CD.
- >
- >Error Message I get:
- >
- >--------------------Configuration: Text1 - Win32
- >Debug--------------------
- >Compiling...
- >Text1.cpp
- >C:\home\patrick\msdv\simple_odbc\Text1.cpp(26) : error C2664:
- >'SQLConnect' :
- >cannot convert parameter 2 from 'char [8]' to 'unsigned char *' (new
- >behavior; please see help)
-
- >retcode = SQLConnect(hdbc, "EmpData", SQL_NTS,
- >"JohnS", SQL_NTS,
- >"Sesame", SQL_NTS);
- >
- ODBC uses unsigned characters. You gotta cast all your
- 'ordinary' (signed) chars to unsigned:
-
- SQLConnect(hdbc, (UCHAR FAR*)"EmpData", .....
-
- The FAR business isn't really needed in WIN32, but that's
- what the prototype has so to be safe, use it.
-
- --
- Pete Grant
- Kalevi, Inc.
- Software Engineering & development
-